﻿<Window x:Class="IS_Ever_Green.View.AdminView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:IS_Ever_Green.View"
        xmlns:viewModel="clr-namespace:IS_Ever_Green.ViewModel" 
        mc:Ignorable="d"
        Height="1024" Width="1440"
        WindowStyle="None"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterScreen"
        MouseDown="Window_MouseDown"
        Background="Transparent"
        AllowsTransparency="True"
        >

    <Window.DataContext>
        <viewModel:AdminViewModel/>
    </Window.DataContext>

    <Window.Resources>
        <DataTemplate DataType="{x:Type viewModel:HomeAdminViewModel}">
            <local:HomeAdminView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:EmployeeViewModel}">
            <local:EmployeeView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:DetailsViewModel}">
            <local:DetailsView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:ProfileViewModel}">
            <local:ProfileView/>
        </DataTemplate>
    </Window.Resources>

    <Border CornerRadius="16"
            BorderThickness="1"
            Background="{StaticResource panelColorMain}">

        <Border.BorderBrush>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                <GradientStop Color="{StaticResource winBorderColor1}" Offset="0.0"/>
                <GradientStop Color="{StaticResource winBorderColor2}" Offset="0.5"/>
                <GradientStop Color="{StaticResource winBorderColor3}" Offset="1.0"/>
            </LinearGradientBrush>
        </Border.BorderBrush>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="300"/>
                <ColumnDefinition Width="*"/>

            </Grid.ColumnDefinitions>


            <Border CornerRadius="16"
                    Grid.Column="0"
                    Background="{StaticResource panelColorNav}"
                    >
                <StackPanel>

                    <Grid Margin="16 16 0 0">

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="40"/>
                            <ColumnDefinition Width="40"/>
                        </Grid.ColumnDefinitions>

                        <Button x:Name="btnClose" 
                                    BorderThickness="0"
                                    Content="X"
                                    Foreground="{StaticResource secondaryTextColor}"
                                    FontSize="16"
                                    FontFamily="Montserrat"
                                    Cursor="Hand"
                                    Grid.Column="0"
                                    Click="btnClose_Click"
                                    >

                            <Button.Style>
                                <Style TargetType="Button">
                                    <Setter Property="Background" Value="{StaticResource primaryButtonColor}"/>
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" Value="{StaticResource primaryButtonHoverColor}"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>

                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border Width="30" Height="30"
                                                CornerRadius="15"
                                                Background="{TemplateBinding Background}">

                                        <ContentPresenter VerticalAlignment="Center"
                                                              HorizontalAlignment="Center"/>

                                    </Border>
                                </ControlTemplate>
                            </Button.Template>

                        </Button>

                        <Button x:Name="btnMinimize" 
                                    BorderThickness="0"
                                    Content="-"
                                    Foreground="{StaticResource secondaryTextColor}"
                                    FontSize="25"
                                    FontFamily="Montserrat"
                                    Cursor="Hand"
                                    Grid.Column="1"
                                    Click="btnMinimize_Click"
                                    >

                            <Button.Style>
                                <Style TargetType="Button">
                                    <Setter Property="Background" Value="{StaticResource secondaryButtonColor}"/>
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" Value="{StaticResource secondaryButtonHoverColor}"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>

                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border Width="30" Height="30" 
                                                CornerRadius="15"
                                                Background="{TemplateBinding Background}">

                                        <ContentPresenter VerticalAlignment="Center"
                                                              HorizontalAlignment="Center"/>

                                    </Border>
                                </ControlTemplate>
                            </Button.Template>

                        </Button>

                    </Grid>

                    <StackPanel Orientation="Horizontal"
                                Width="280"
                                HorizontalAlignment="Left"
                                Margin="8 16 22 50">

                        <Image Source="/Images/LogoName.png" Height="70" Width="230"/>

                    </StackPanel>

                    <RadioButton Command="{Binding ShowHomeViewCommand}"
                                 Style="{StaticResource menuButton}"
                                 Tag="{StaticResource activePageColor}"
                                 IsChecked="True">

                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Images/Menu/Home.png" Style="{StaticResource menuButtonIcon}"/>
                            <TextBlock Text="Каталог" Style="{StaticResource menuButtonText}"/>
                        </StackPanel>

                    </RadioButton>

                    <RadioButton Command="{Binding ShowEmployeeViewCommand}"
                                 Style="{StaticResource menuButton}"
                                 Tag="{StaticResource activePageColor}">

                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Images/Menu/Employee.png" Style="{StaticResource menuButtonIcon}"/>
                            <TextBlock Text="Сотрудники" Style="{StaticResource menuButtonText}"/>
                        </StackPanel>

                    </RadioButton>

                    <RadioButton Command="{Binding ShowDetailViewCommand}"
                                 Style="{StaticResource menuButton}"
                                 Tag="{StaticResource activePageColor}">

                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Images/Menu/Details.png" Style="{StaticResource menuButtonIcon}"/>
                            <TextBlock Text="Детали" Style="{StaticResource menuButtonText}"/>
                        </StackPanel>

                    </RadioButton>

                    <RadioButton Command="{Binding ShowProfileViewCommand}"
                                 Style="{StaticResource menuButton}"
                                 Tag="{StaticResource activePageColor}">

                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Images/Menu/Profile.png" Style="{StaticResource menuButtonIcon}"/>
                            <TextBlock Text="Профиль" Style="{StaticResource menuButtonText}"/>
                        </StackPanel>

                    </RadioButton>

                </StackPanel>
            </Border>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>


                <Button Content="Выйти"
                        Grid.Row="2"
                        BorderThickness="0"
                        Foreground="{StaticResource secondaryTextColor}"
                        FontSize="16"
                        FontFamily="Montserrat"
                        Cursor="Hand"
                        Grid.Column="1"
                        Margin="0 0 0 45"
                        Click="Exit_Click"
                        >

                    <Button.Style>
                        <Style TargetType="Button">
                            <Setter Property="Background" Value="{StaticResource primaryButtonColor}"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="{StaticResource primaryButtonHoverColor}"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Button.Style>

                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Border Width="180" Height="60"
                                    CornerRadius="16"
                                    Background="{TemplateBinding Background}">

                                <ContentPresenter VerticalAlignment="Center"
                                    HorizontalAlignment="Center"/>

                            </Border>
                        </ControlTemplate>
                    </Button.Template>

                </Button>

            </Grid>


            <Border CornerRadius="0 10 10 0" 
                    Grid.Column="1"
                    Margin="32 32 32 46"
                    >

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="100"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <Grid>
                        <TextBlock Text="{Binding Caption}"
                                   Foreground="{StaticResource primaryTextColor}"
                                   FontSize="20"
                                   FontFamily="Montserrat"
                                   Width="250"
                                   Height="24"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Top"
                                   />

                        <TextBlock Text="{Binding CaptionMain}"
                                   Foreground="{StaticResource primaryTextColor}"
                                   FontSize="30"
                                   FontFamily="Montserrat"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Top"
                                   Margin="0 35 0 0"
                                   />

                        <Border CornerRadius="30"
                                Background="{StaticResource panelColorNav}"
                                Height="60"
                                Width="430"
                                HorizontalAlignment="Right"
                                >
                            <StackPanel Orientation="Horizontal">

                                <Border CornerRadius="20"
                                        Background="{StaticResource panelColorMain}"
                                        Width="300"
                                        Height="40"
                                        HorizontalAlignment="Left"
                                        Margin="10 0 0 0"
                                        >

                                    <TextBox Text=""
                                                 FontSize="30"
                                                 Width="280"
                                                 Height="30"
                                                 FontWeight="Medium"
                                                 FontFamily="Montserrat"
                                                 CaretBrush="{StaticResource markerColor}"
                                                 HorizontalAlignment="Left"
                                                 Margin="10 0 0 0"
                                                 Padding="20 0 0 0"
                                                 BorderThickness="0"
                                                 >

                                        <TextBox.Background>
                                            <ImageBrush ImageSource="/Images/Search.png"
                                                            Stretch="none"
                                                            AlignmentX="Left"
                                                            />
                                        </TextBox.Background>
                                    </TextBox>

                                </Border>

                                <Button Height="25" 
                                        Width="25" 
                                        Margin="25 0 0 0"
                                        BorderThickness="0"
                                        Cursor="Hand"
                                        >
                                    <Button.Background>
                                        <ImageBrush ImageSource="/Images/Moon.png"/>
                                    </Button.Background>

                                    <Button.Style>
                                        <Style TargetType="Button">
                                            <Setter Property="Background" Value="Transparent"/>
                                            <Style.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter Property="Background" Value="Transparent"/>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Button.Style>

                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <Border CornerRadius="15"
                                                    Background="{TemplateBinding Background}">

                                                <ContentPresenter VerticalAlignment="Center"
                                                                  HorizontalAlignment="Center"/>

                                            </Border>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>

                                <Border CornerRadius="20"
                                        Background="{StaticResource panelColorMain}"
                                        Width="40"
                                        Height="40"
                                        Margin="10 0 0 0"
                                        >

                                    <Image>
                                        <Image.Style>
                                            <Style TargetType="Image">
                                                <Setter Property="Source" Value="{Binding CurrentUser.PhotoUser}" />
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding CurrentUser.PhotoUser}" Value="{x:Null}">
                                                        <Setter Property="Source" Value="/Images/Default_profile_image.png" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Image.Style>
                                    </Image>

                                </Border>

                            </StackPanel>

                        </Border>



                    </Grid>

                    <Border Grid.Row="2" 
                            CornerRadius="16" 
                            Margin="0 70 0 0" 
                            Background="{StaticResource panelContentColor}">

                        <ContentControl Content="{Binding BaseViewModel}"/>
                    </Border>

                </Grid>

            </Border>

        </Grid>
        
    </Border>
</Window>
